<template>
    <el-row>
        <el-col>
            用户<el-input
                v-model="user"
                style="width: 90%; padding: 0 10px"
                placeholder="Please input"
                clearable
            />
        </el-col>
        <el-col>
            内容<el-input
                v-model="content"
                style="width: 90%; padding:  10px"
                placeholder="Please input"
                clearable
            />
        </el-col>
        <el-col>
            状态<el-input
                v-model="status"
                style="width: 90%; padding: 0 10px"
                placeholder="Please input"
                clearable
            />
        </el-col>
        <el-col>
            回复人<el-input
                v-model="tuser"
                style="width: 90%; padding:  10px"
                placeholder="Please input"
                clearable
            />
        </el-col>
        <el-col style="text-align: right">
            <el-button @click="cancle">取消</el-button>
            <el-button style="margin-right: 20px" @click="save">保存</el-button>
        </el-col>
    </el-row>
</template>
<script setup>
    import { ref, defineEmits,defineProps } from 'vue'
    const emites = defineEmits(['operate'])
    let props = defineProps({
        zhuti: {
            type: Object,
            default: () => {
                return {}
            }
        }
    })
    let zhutis = ref(props.zhuti)
    let user = ref(zhutis.value.user)
    let content = ref(zhutis.value.content)
    let tuser = ref(zhutis.value.tuser)
    let status = ref(zhutis.value.status)
    const save = function () {
        emites('operate', {
            id:zhutis.value.id,
            user: user.value,
            content: content.value,
            tuser: tuser.value,
            status: status.value,
            del: 1
        })
        
    }
    const cancle = function () {
        emites('operate')
    }
</script>